<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: fabgl::KeyboardClass Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 VGA Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classfabgl_1_1_keyboard_class.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classfabgl_1_1_keyboard_class-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">fabgl::KeyboardClass Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The PS2 Keyboard controller class.  
 <a href="classfabgl_1_1_keyboard_class.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="keyboard_8h_source.html">keyboard.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for fabgl::KeyboardClass:</div>
<div class="dyncontent">
<div class="center"><img src="classfabgl_1_1_keyboard_class__inherit__graph.png" border="0" usemap="#fabgl_1_1_keyboard_class_inherit__map" alt="Inheritance graph"/></div>
<map name="fabgl_1_1_keyboard_class_inherit__map" id="fabgl_1_1_keyboard_class_inherit__map">
<area shape="rect" id="node2" href="classfabgl_1_1_p_s2_device_class.html" title="Base class for PS2 devices (like mouse or keyboard). " alt="" coords="5,5,162,31"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for fabgl::KeyboardClass:</div>
<div class="dyncontent">
<div class="center"><img src="classfabgl_1_1_keyboard_class__coll__graph.png" border="0" usemap="#fabgl_1_1_keyboard_class_coll__map" alt="Collaboration graph"/></div>
<map name="fabgl_1_1_keyboard_class_coll__map" id="fabgl_1_1_keyboard_class_coll__map">
<area shape="rect" id="node2" href="classfabgl_1_1_p_s2_device_class.html" title="Base class for PS2 devices (like mouse or keyboard). " alt="" coords="5,5,162,31"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae9d8a142c516c27a1760944b07a87f93"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93">begin</a> (gpio_num_t clkGPIO, gpio_num_t dataGPIO, bool generateVirtualKeys=true, bool createVKQueue=true)</td></tr>
<tr class="memdesc:ae9d8a142c516c27a1760944b07a87f93"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes <a class="el" href="classfabgl_1_1_keyboard_class.html" title="The PS2 Keyboard controller class. ">KeyboardClass</a> specifying CLOCK and DATA GPIOs.  <a href="#ae9d8a142c516c27a1760944b07a87f93">More...</a><br /></td></tr>
<tr class="separator:ae9d8a142c516c27a1760944b07a87f93"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4b9610e8c76fcb88c41113c9537b396"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#af4b9610e8c76fcb88c41113c9537b396">begin</a> (bool generateVirtualKeys, bool createVKQueue, int PS2Port)</td></tr>
<tr class="memdesc:af4b9610e8c76fcb88c41113c9537b396"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes <a class="el" href="classfabgl_1_1_keyboard_class.html" title="The PS2 Keyboard controller class. ">KeyboardClass</a> without initializing the PS/2 controller.  <a href="#af4b9610e8c76fcb88c41113c9537b396">More...</a><br /></td></tr>
<tr class="separator:af4b9610e8c76fcb88c41113c9537b396"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d430ea3eeaeaa6fbf57fb534e640bf6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a3d430ea3eeaeaa6fbf57fb534e640bf6">emptyVirtualKeyQueue</a> ()</td></tr>
<tr class="memdesc:a3d430ea3eeaeaa6fbf57fb534e640bf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Empties the virtual keys queue.  <a href="#a3d430ea3eeaeaa6fbf57fb534e640bf6">More...</a><br /></td></tr>
<tr class="separator:a3d430ea3eeaeaa6fbf57fb534e640bf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7919c90b9cc0af1800b18aba04d0218"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structfabgl_1_1_keyboard_layout.html">KeyboardLayout</a> const  *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#ae7919c90b9cc0af1800b18aba04d0218">getLayout</a> ()</td></tr>
<tr class="memdesc:ae7919c90b9cc0af1800b18aba04d0218"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets current keyboard layout.  <a href="#ae7919c90b9cc0af1800b18aba04d0218">More...</a><br /></td></tr>
<tr class="separator:ae7919c90b9cc0af1800b18aba04d0218"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe546ebdba6772d110341389d9d102d7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#abe546ebdba6772d110341389d9d102d7">getLEDs</a> (bool *numLock, bool *capsLock, bool *scrollLock)</td></tr>
<tr class="memdesc:abe546ebdba6772d110341389d9d102d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets keyboard LEDs status.  <a href="#abe546ebdba6772d110341389d9d102d7">More...</a><br /></td></tr>
<tr class="separator:abe546ebdba6772d110341389d9d102d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56e01f2289d9bb02d19e08fece4c731c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a56e01f2289d9bb02d19e08fece4c731c">getNextScancode</a> (int timeOutMS=-1, bool requestResendOnTimeOut=false)</td></tr>
<tr class="memdesc:a56e01f2289d9bb02d19e08fece4c731c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a scancode from the queue.  <a href="#a56e01f2289d9bb02d19e08fece4c731c">More...</a><br /></td></tr>
<tr class="separator:a56e01f2289d9bb02d19e08fece4c731c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5bcb0c200a35ece54ecdf4cd47e49d6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enumerations.html#gae12c31a33f64281cba424d993a8a4381">VirtualKey</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#ae5bcb0c200a35ece54ecdf4cd47e49d6">getNextVirtualKey</a> (bool *keyDown=nullptr, int timeOutMS=-1)</td></tr>
<tr class="memdesc:ae5bcb0c200a35ece54ecdf4cd47e49d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a virtual key from the queue.  <a href="#ae5bcb0c200a35ece54ecdf4cd47e49d6">More...</a><br /></td></tr>
<tr class="separator:ae5bcb0c200a35ece54ecdf4cd47e49d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a3cfd9086abb1d0dda31e5f9c22f40e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enumerations.html#ga209a520f6108c21bd313cb2c98fde74a">PS2Device</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_device_class.html#a6a3cfd9086abb1d0dda31e5f9c22f40e">identify</a> ()</td></tr>
<tr class="memdesc:a6a3cfd9086abb1d0dda31e5f9c22f40e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Identifies the device attached to the PS2 port.  <a href="#a6a3cfd9086abb1d0dda31e5f9c22f40e">More...</a><br /></td></tr>
<tr class="separator:a6a3cfd9086abb1d0dda31e5f9c22f40e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c07c13d95a52b5c8d91a7328fe17930"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a5c07c13d95a52b5c8d91a7328fe17930">isKeyboardAvailable</a> ()</td></tr>
<tr class="memdesc:a5c07c13d95a52b5c8d91a7328fe17930"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if keyboard has been detected and correctly initialized.  <a href="#a5c07c13d95a52b5c8d91a7328fe17930">More...</a><br /></td></tr>
<tr class="separator:a5c07c13d95a52b5c8d91a7328fe17930"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abff01a859f8069a8ecb12c519c9df008"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#abff01a859f8069a8ecb12c519c9df008">isVKDown</a> (<a class="el" href="group___enumerations.html#gae12c31a33f64281cba424d993a8a4381">VirtualKey</a> virtualKey)</td></tr>
<tr class="memdesc:abff01a859f8069a8ecb12c519c9df008"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the virtual keys status.  <a href="#abff01a859f8069a8ecb12c519c9df008">More...</a><br /></td></tr>
<tr class="separator:abff01a859f8069a8ecb12c519c9df008"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c5e9c28380d81e8ca53875e7bf30e5c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_device_class.html#a0c5e9c28380d81e8ca53875e7bf30e5c">lock</a> (int timeOutMS)</td></tr>
<tr class="memdesc:a0c5e9c28380d81e8ca53875e7bf30e5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets exclusive access to the device.  <a href="#a0c5e9c28380d81e8ca53875e7bf30e5c">More...</a><br /></td></tr>
<tr class="separator:a0c5e9c28380d81e8ca53875e7bf30e5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09ac1cafc7c2b1f2b16fece0f969bfd3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a09ac1cafc7c2b1f2b16fece0f969bfd3">reset</a> ()</td></tr>
<tr class="memdesc:a09ac1cafc7c2b1f2b16fece0f969bfd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a Reset command to the keyboard.  <a href="#a09ac1cafc7c2b1f2b16fece0f969bfd3">More...</a><br /></td></tr>
<tr class="separator:a09ac1cafc7c2b1f2b16fece0f969bfd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc84336586414c7b19cd879f96a06583"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#afc84336586414c7b19cd879f96a06583">scancodeAvailable</a> ()</td></tr>
<tr class="memdesc:afc84336586414c7b19cd879f96a06583"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of scancodes available in the queue.  <a href="#afc84336586414c7b19cd879f96a06583">More...</a><br /></td></tr>
<tr class="separator:afc84336586414c7b19cd879f96a06583"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08b281a865847dfc514b2f0c7d77e095"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a08b281a865847dfc514b2f0c7d77e095">setLayout</a> (<a class="el" href="structfabgl_1_1_keyboard_layout.html">KeyboardLayout</a> const *layout)</td></tr>
<tr class="memdesc:a08b281a865847dfc514b2f0c7d77e095"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets keyboard layout.  <a href="#a08b281a865847dfc514b2f0c7d77e095">More...</a><br /></td></tr>
<tr class="separator:a08b281a865847dfc514b2f0c7d77e095"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7c233605976b3a37c679f0203210fa4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#ae7c233605976b3a37c679f0203210fa4">setLEDs</a> (bool numLock, bool capsLock, bool scrollLock)</td></tr>
<tr class="memdesc:ae7c233605976b3a37c679f0203210fa4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets keyboard LEDs status.  <a href="#ae7c233605976b3a37c679f0203210fa4">More...</a><br /></td></tr>
<tr class="separator:ae7c233605976b3a37c679f0203210fa4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae98950d23410af6fb820787c54b43198"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#ae98950d23410af6fb820787c54b43198">setTypematicRateAndDelay</a> (int repeatRateMS, int repeatDelayMS)</td></tr>
<tr class="memdesc:ae98950d23410af6fb820787c54b43198"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets typematic rate and delay.  <a href="#ae98950d23410af6fb820787c54b43198">More...</a><br /></td></tr>
<tr class="separator:ae98950d23410af6fb820787c54b43198"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c35974d5a23cc4e110d9ec830b2b587"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a6c35974d5a23cc4e110d9ec830b2b587">setUIApp</a> (<a class="el" href="classfabgl_1_1ui_app.html">uiApp</a> *app)</td></tr>
<tr class="memdesc:a6c35974d5a23cc4e110d9ec830b2b587"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets current UI app.  <a href="#a6c35974d5a23cc4e110d9ec830b2b587">More...</a><br /></td></tr>
<tr class="separator:a6c35974d5a23cc4e110d9ec830b2b587"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d79d73d9a71bbe889a89cb6358d64db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a7d79d73d9a71bbe889a89cb6358d64db">suspendVirtualKeyGeneration</a> (bool value)</td></tr>
<tr class="memdesc:a7d79d73d9a71bbe889a89cb6358d64db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Suspends or resume the virtual key generation task.  <a href="#a7d79d73d9a71bbe889a89cb6358d64db">More...</a><br /></td></tr>
<tr class="separator:a7d79d73d9a71bbe889a89cb6358d64db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed4e98813779c2d51bd304aef5aed7e9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_device_class.html#aed4e98813779c2d51bd304aef5aed7e9">unlock</a> ()</td></tr>
<tr class="memdesc:aed4e98813779c2d51bd304aef5aed7e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases device from exclusive access.  <a href="#aed4e98813779c2d51bd304aef5aed7e9">More...</a><br /></td></tr>
<tr class="separator:aed4e98813779c2d51bd304aef5aed7e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa93820f1c8f447a37c01376a8d6dbba0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#aa93820f1c8f447a37c01376a8d6dbba0">virtualKeyAvailable</a> ()</td></tr>
<tr class="memdesc:aa93820f1c8f447a37c01376a8d6dbba0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of virtual keys available in the queue.  <a href="#aa93820f1c8f447a37c01376a8d6dbba0">More...</a><br /></td></tr>
<tr class="separator:aa93820f1c8f447a37c01376a8d6dbba0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fba5778b3518e9aa2d397e0da71520e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_keyboard_class.html#a7fba5778b3518e9aa2d397e0da71520e">virtualKeyToASCII</a> (<a class="el" href="group___enumerations.html#gae12c31a33f64281cba424d993a8a4381">VirtualKey</a> virtualKey)</td></tr>
<tr class="memdesc:a7fba5778b3518e9aa2d397e0da71520e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts virtual key to ASCII.  <a href="#a7fba5778b3518e9aa2d397e0da71520e">More...</a><br /></td></tr>
<tr class="separator:a7fba5778b3518e9aa2d397e0da71520e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The PS2 Keyboard controller class. </p>
<p><a class="el" href="classfabgl_1_1_keyboard_class.html" title="The PS2 Keyboard controller class. ">KeyboardClass</a> connects to one port of the PS2 Controller class (<a class="el" href="classfabgl_1_1_p_s2_controller_class.html" title="The PS2 device controller class. ">fabgl::PS2ControllerClass</a>) and provides the logic that converts scancodes to virtual keys or ASCII (and ANSI) codes.<br />
 It optionally creates a task that waits for scan codes from the PS2 device and puts virtual keys in a queue.<br />
 The PS2 controller uses ULP coprocessor and RTC slow memory to communicate with the PS2 device.<br />
 <br />
 It is possible to specify an international keyboard layout. The default is US-layout.<br />
 There are three predefined kayboard layouts: US (USA), UK (United Kingdom), DE (German) and IT (Italian). Other layout can be added inheriting from US or from any other layout.</p>
<p>Applications do not need to create an instance of <a class="el" href="classfabgl_1_1_keyboard_class.html" title="The PS2 Keyboard controller class. ">KeyboardClass</a> because an instance named Keyboard is created automatically.</p>
<p>Example: </p><pre class="fragment">// Setup pins GPIO33 for CLK and GPIO32 for DATA
Keyboard.begin(GPIO_NUM_33, GPIO_NUM_32);  // clk, dat

// Prints name of received virtual keys
while (true)
  Serial.printf("VirtualKey = %s\n", Keyboard.virtualKeyToString(Keyboard.getNextVirtualKey()));</pre> </div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ae9d8a142c516c27a1760944b07a87f93"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9d8a142c516c27a1760944b07a87f93">&#9670;&nbsp;</a></span>begin() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::KeyboardClass::begin </td>
          <td>(</td>
          <td class="paramtype">gpio_num_t&#160;</td>
          <td class="paramname"><em>clkGPIO</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">gpio_num_t&#160;</td>
          <td class="paramname"><em>dataGPIO</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>generateVirtualKeys</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>createVKQueue</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes <a class="el" href="classfabgl_1_1_keyboard_class.html" title="The PS2 Keyboard controller class. ">KeyboardClass</a> specifying CLOCK and DATA GPIOs. </p>
<p>A reset command (<a class="el" href="classfabgl_1_1_keyboard_class.html#a09ac1cafc7c2b1f2b16fece0f969bfd3" title="Sends a Reset command to the keyboard. ">KeyboardClass.reset()</a> method) is automatically sent to the keyboard.<br />
 This method also initializes the <a class="el" href="classfabgl_1_1_p_s2_controller_class.html" title="The PS2 device controller class. ">PS2ControllerClass</a> to use port 0 only.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">clkGPIO</td><td>The GPIO number of Clock line </td></tr>
    <tr><td class="paramname">dataGPIO</td><td>The GPIO number of Data line </td></tr>
    <tr><td class="paramname">generateVirtualKeys</td><td>If true creates a task which consumes scancodes to produce virtual keys, so you can call <a class="el" href="classfabgl_1_1_keyboard_class.html#abff01a859f8069a8ecb12c519c9df008" title="Gets the virtual keys status. ">KeyboardClass.isVKDown()</a>. </td></tr>
    <tr><td class="paramname">createVKQueue</td><td>If true creates a task which consunes scancodes and produces virtual keys and put them in a queue, so you can call <a class="el" href="classfabgl_1_1_keyboard_class.html#abff01a859f8069a8ecb12c519c9df008" title="Gets the virtual keys status. ">KeyboardClass.isVKDown()</a>, <a class="el" href="classfabgl_1_1_keyboard_class.html#aa93820f1c8f447a37c01376a8d6dbba0" title="Gets the number of virtual keys available in the queue. ">KeyboardClass.virtualKeyAvailable()</a> and <a class="el" href="classfabgl_1_1_keyboard_class.html#ae5bcb0c200a35ece54ecdf4cd47e49d6" title="Gets a virtual key from the queue. ">KeyboardClass.getNextVirtualKey()</a>.</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">// Setup pins GPIO33 for CLK and GPIO32 for DATA
Keyboard.begin(GPIO_NUM_33, GPIO_NUM_32);  // clk, dat</pre> 
</div>
</div>
<a id="af4b9610e8c76fcb88c41113c9537b396"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4b9610e8c76fcb88c41113c9537b396">&#9670;&nbsp;</a></span>begin() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::KeyboardClass::begin </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>generateVirtualKeys</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>createVKQueue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>PS2Port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes <a class="el" href="classfabgl_1_1_keyboard_class.html" title="The PS2 Keyboard controller class. ">KeyboardClass</a> without initializing the PS/2 controller. </p>
<p>A reset command (<a class="el" href="classfabgl_1_1_keyboard_class.html#a09ac1cafc7c2b1f2b16fece0f969bfd3" title="Sends a Reset command to the keyboard. ">KeyboardClass.reset()</a> method) is automatically sent to the keyboard.<br />
 This method does not initialize the <a class="el" href="classfabgl_1_1_p_s2_controller_class.html" title="The PS2 device controller class. ">PS2ControllerClass</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">generateVirtualKeys</td><td>If true creates a task which consumes scancodes and produces virtual keys, so you can call <a class="el" href="classfabgl_1_1_keyboard_class.html#abff01a859f8069a8ecb12c519c9df008" title="Gets the virtual keys status. ">KeyboardClass.isVKDown()</a>. </td></tr>
    <tr><td class="paramname">createVKQueue</td><td>If true creates a task which consunes scancodes to produce virtual keys and put them in a queue, so you can call <a class="el" href="classfabgl_1_1_keyboard_class.html#abff01a859f8069a8ecb12c519c9df008" title="Gets the virtual keys status. ">KeyboardClass.isVKDown()</a>, <a class="el" href="classfabgl_1_1_keyboard_class.html#aa93820f1c8f447a37c01376a8d6dbba0" title="Gets the number of virtual keys available in the queue. ">KeyboardClass.virtualKeyAvailable()</a> and <a class="el" href="classfabgl_1_1_keyboard_class.html#ae5bcb0c200a35ece54ecdf4cd47e49d6" title="Gets a virtual key from the queue. ">KeyboardClass.getNextVirtualKey()</a>. </td></tr>
    <tr><td class="paramname">PS2Port</td><td>The PS/2 port to use (0 or 1).</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">// Setup pins GPIO33 for CLK and GPIO32 for DATA on port 0
PS2Controller.begin(GPIO_NUM_33, GPIO_NUM_32); // clk, dat
Keyboard.begin(true, true, 0); // port 0</pre> 
</div>
</div>
<a id="a3d430ea3eeaeaa6fbf57fb534e640bf6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d430ea3eeaeaa6fbf57fb534e640bf6">&#9670;&nbsp;</a></span>emptyVirtualKeyQueue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::KeyboardClass::emptyVirtualKeyQueue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Empties the virtual keys queue. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_v_i_c20_2_v_i_c20_8ino-example.html#a8">VIC20/VIC20.ino</a>.</dd>
</dl>
</div>
</div>
<a id="ae7919c90b9cc0af1800b18aba04d0218"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7919c90b9cc0af1800b18aba04d0218">&#9670;&nbsp;</a></span>getLayout()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structfabgl_1_1_keyboard_layout.html">KeyboardLayout</a> const* fabgl::KeyboardClass::getLayout </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets current keyboard layout. </p>
<dl class="section return"><dt>Returns</dt><dd>The default or last set keyboard layout. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a8">KeyboardStudio/KeyboardStudio.ino</a>.</dd>
</dl>
</div>
</div>
<a id="abe546ebdba6772d110341389d9d102d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe546ebdba6772d110341389d9d102d7">&#9670;&nbsp;</a></span>getLEDs()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::KeyboardClass::getLEDs </td>
          <td>(</td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>numLock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>capsLock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>scrollLock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets keyboard LEDs status. </p>
<p>Use this method to know the current status of NUMLOCK, CAPSLOCK and SCROLLLOCK LEDs.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">numLock</td><td>When true the NUMLOCK LED is switched on. </td></tr>
    <tr><td class="paramname">capsLock</td><td>When true the CAPSLOCK LED is switched on. </td></tr>
    <tr><td class="paramname">scrollLock</td><td>When true the SCROLLLOCK LED is switched on. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a56e01f2289d9bb02d19e08fece4c731c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56e01f2289d9bb02d19e08fece4c731c">&#9670;&nbsp;</a></span>getNextScancode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fabgl::KeyboardClass::getNextScancode </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>timeOutMS</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>requestResendOnTimeOut</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets a scancode from the queue. </p>
<p>Scancodes are always generated but they can be consumed by the scancode-to-virtualkeys task. So, in order to use this method <a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93" title="Initializes KeyboardClass specifying CLOCK and DATA GPIOs. ">KeyboardClass.begin()</a> method should be called with generateVirtualKeys = false and createVKQueue = false.<br />
 Alternatively it is also possible to suspend the conversion task calling <a class="el" href="classfabgl_1_1_keyboard_class.html#a7d79d73d9a71bbe889a89cb6358d64db" title="Suspends or resume the virtual key generation task. ">KeyboardClass.suspendVirtualKeyGeneration()</a> method.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">timeOutMS</td><td>Timeout in milliseconds. -1 means no timeout (infinite time). </td></tr>
    <tr><td class="paramname">requestResendOnTimeOut</td><td>If true and timeout has expired then asks the keyboard to resend the scancode.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The first scancode of the queue (-1 if no data is available in the timeout period). </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a16">KeyboardStudio/KeyboardStudio.ino</a>.</dd>
</dl>
</div>
</div>
<a id="ae5bcb0c200a35ece54ecdf4cd47e49d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae5bcb0c200a35ece54ecdf4cd47e49d6">&#9670;&nbsp;</a></span>getNextVirtualKey()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___enumerations.html#gae12c31a33f64281cba424d993a8a4381">VirtualKey</a> fabgl::KeyboardClass::getNextVirtualKey </td>
          <td>(</td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>keyDown</em> = <code>nullptr</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>timeOutMS</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets a virtual key from the queue. </p>
<p>Virtual keys are generated from scancodes only if generateVirtualKeys parameter is true (default) and createVKQueue parameter is true (default) of <a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93" title="Initializes KeyboardClass specifying CLOCK and DATA GPIOs. ">KeyboardClass.begin()</a> method.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keyDown</td><td>A pointer to boolean variable which will contain if the virtual key is depressed (true) or released (false). </td></tr>
    <tr><td class="paramname">timeOutMS</td><td>Timeout in milliseconds. -1 means no timeout (infinite time).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The first virtual key of the queue (VK_NONE if no data is available in the timeout period). </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a18">KeyboardStudio/KeyboardStudio.ino</a>, and <a class="el" href="_v_i_c20_2_v_i_c20_8ino-example.html#a13">VIC20/VIC20.ino</a>.</dd>
</dl>
</div>
</div>
<a id="a6a3cfd9086abb1d0dda31e5f9c22f40e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a3cfd9086abb1d0dda31e5f9c22f40e">&#9670;&nbsp;</a></span>identify()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___enumerations.html#ga209a520f6108c21bd313cb2c98fde74a">PS2Device</a> fabgl::PS2DeviceClass::identify </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Identifies the device attached to the PS2 port. </p>
<dl class="section return"><dt>Returns</dt><dd>The identification ID sent by keyboard. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a1">KeyboardStudio/KeyboardStudio.ino</a>, and <a class="el" href="_mouse_studio_2_mouse_studio_8ino-example.html#a1">MouseStudio/MouseStudio.ino</a>.</dd>
</dl>
</div>
</div>
<a id="a5c07c13d95a52b5c8d91a7328fe17930"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c07c13d95a52b5c8d91a7328fe17930">&#9670;&nbsp;</a></span>isKeyboardAvailable()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool fabgl::KeyboardClass::isKeyboardAvailable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Checks if keyboard has been detected and correctly initialized. </p>
<p><a class="el" href="classfabgl_1_1_keyboard_class.html#a5c07c13d95a52b5c8d91a7328fe17930" title="Checks if keyboard has been detected and correctly initialized. ">isKeyboardAvailable()</a> returns a valid value only after <a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93" title="Initializes KeyboardClass specifying CLOCK and DATA GPIOs. ">KeyboardClass.begin()</a> or <a class="el" href="classfabgl_1_1_keyboard_class.html#a09ac1cafc7c2b1f2b16fece0f969bfd3" title="Sends a Reset command to the keyboard. ">KeyboardClass.reset()</a> has been called.</p>
<dl class="section return"><dt>Returns</dt><dd>True if the keyboard is correctly initialized. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_ansi_terminal_2_ansi_terminal_8ino-example.html#a11">AnsiTerminal/AnsiTerminal.ino</a>, <a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a0">KeyboardStudio/KeyboardStudio.ino</a>, <a class="el" href="_loopback_terminal_2_loopback_terminal_8ino-example.html#a2">LoopbackTerminal/LoopbackTerminal.ino</a>, <a class="el" href="_network_terminal_2_network_terminal_8ino-example.html#a2">NetworkTerminal/NetworkTerminal.ino</a>, and <a class="el" href="_space_invaders_2_space_invaders_8ino-example.html#a16">SpaceInvaders/SpaceInvaders.ino</a>.</dd>
</dl>
</div>
</div>
<a id="abff01a859f8069a8ecb12c519c9df008"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abff01a859f8069a8ecb12c519c9df008">&#9670;&nbsp;</a></span>isVKDown()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool fabgl::KeyboardClass::isVKDown </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___enumerations.html#gae12c31a33f64281cba424d993a8a4381">VirtualKey</a>&#160;</td>
          <td class="paramname"><em>virtualKey</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the virtual keys status. </p>
<p>This method allows to know the status of each virtual key (Down or Up).<br />
 Virtual keys are generated from scancodes only if generateVirtualKeys parameter of <a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93" title="Initializes KeyboardClass specifying CLOCK and DATA GPIOs. ">KeyboardClass.begin()</a> method is true (default).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">virtualKey</td><td>The Virtual Key to test.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if the specified virtual key is down. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_space_invaders_2_space_invaders_8ino-example.html#a18">SpaceInvaders/SpaceInvaders.ino</a>.</dd>
</dl>
</div>
</div>
<a id="a0c5e9c28380d81e8ca53875e7bf30e5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c5e9c28380d81e8ca53875e7bf30e5c">&#9670;&nbsp;</a></span>lock()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool fabgl::PS2DeviceClass::lock </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>timeOutMS</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets exclusive access to the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">timeOutMS</td><td>Timeout in milliseconds to wait before fail.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if the device has been locked. </dd></dl>

</div>
</div>
<a id="a09ac1cafc7c2b1f2b16fece0f969bfd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a09ac1cafc7c2b1f2b16fece0f969bfd3">&#9670;&nbsp;</a></span>reset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool fabgl::KeyboardClass::reset </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends a Reset command to the keyboard. </p>
<dl class="section return"><dt>Returns</dt><dd>True if the keyboard is correctly initialized. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a12">KeyboardStudio/KeyboardStudio.ino</a>.</dd>
</dl>
</div>
</div>
<a id="afc84336586414c7b19cd879f96a06583"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc84336586414c7b19cd879f96a06583">&#9670;&nbsp;</a></span>scancodeAvailable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fabgl::KeyboardClass::scancodeAvailable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the number of scancodes available in the queue. </p>
<p>Scancodes are always generated but they can be consumed by the scancode-to-virtualkeys task. So, in order to use this method <a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93" title="Initializes KeyboardClass specifying CLOCK and DATA GPIOs. ">KeyboardClass.begin()</a> method should be called with generateVirtualKeys = false and createVKQueue = false.<br />
 Alternatively it is also possible to suspend the conversion task calling <a class="el" href="classfabgl_1_1_keyboard_class.html#a7d79d73d9a71bbe889a89cb6358d64db" title="Suspends or resume the virtual key generation task. ">KeyboardClass.suspendVirtualKeyGeneration()</a> method.</p>
<dl class="section return"><dt>Returns</dt><dd>The number of scancodes available to read. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a15">KeyboardStudio/KeyboardStudio.ino</a>.</dd>
</dl>
</div>
</div>
<a id="a08b281a865847dfc514b2f0c7d77e095"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a08b281a865847dfc514b2f0c7d77e095">&#9670;&nbsp;</a></span>setLayout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::KeyboardClass::setLayout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfabgl_1_1_keyboard_layout.html">KeyboardLayout</a> const *&#160;</td>
          <td class="paramname"><em>layout</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets keyboard layout. </p>
<p>It is possible to specify an international keyboard layout. The default is US-layout.<br />
 There are three predefined kayboard layouts: US (USA), UK (United Kingdom), DE (German) and IT (Italian). Other layout can be added inheriting from US or from any other layout.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">layout</td><td>A pointer to the layout structure.</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">// Set German layout
setLayout(&amp;fabgl::GermanLayout);</pre> <dl><dt><b>Examples: </b></dt><dd><a class="el" href="_altair8800_2_altair8800_8ino-example.html#a14">Altair8800/Altair8800.ino</a>, <a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a11">KeyboardStudio/KeyboardStudio.ino</a>, and <a class="el" href="_v_i_c20_2_v_i_c20_8ino-example.html#a15">VIC20/VIC20.ino</a>.</dd>
</dl>
</div>
</div>
<a id="ae7c233605976b3a37c679f0203210fa4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7c233605976b3a37c679f0203210fa4">&#9670;&nbsp;</a></span>setLEDs()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool fabgl::KeyboardClass::setLEDs </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>numLock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>capsLock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>scrollLock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets keyboard LEDs status. </p>
<p>Use this method to switch-on or off the NUMLOCK, CAPSLOCK and SCROLLLOCK LEDs.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">numLock</td><td>When true the NUMLOCK LED is switched on. </td></tr>
    <tr><td class="paramname">capsLock</td><td>When true the CAPSLOCK LED is switched on. </td></tr>
    <tr><td class="paramname">scrollLock</td><td>When true the SCROLLLOCK LED is switched on.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if command has been successfully delivered to the keyboard. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a14">KeyboardStudio/KeyboardStudio.ino</a>.</dd>
</dl>
</div>
</div>
<a id="ae98950d23410af6fb820787c54b43198"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae98950d23410af6fb820787c54b43198">&#9670;&nbsp;</a></span>setTypematicRateAndDelay()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool fabgl::KeyboardClass::setTypematicRateAndDelay </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>repeatRateMS</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>repeatDelayMS</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets typematic rate and delay. </p>
<p>If the key is kept pressed down, after repeatDelayMS keyboard starts periodically sending codes with frequency repeatRateMS.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">repeatRateMS</td><td>Repeat rate in milliseconds (in range 33 ms ... 500 ms). </td></tr>
    <tr><td class="paramname">repeatDelayMS</td><td>Repeat delay in milliseconds (in range 250 ms ... 1000 ms, steps of 250 ms).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if command has been successfully delivered to the keyboard. </dd></dl>

</div>
</div>
<a id="a6c35974d5a23cc4e110d9ec830b2b587"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c35974d5a23cc4e110d9ec830b2b587">&#9670;&nbsp;</a></span>setUIApp()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::KeyboardClass::setUIApp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classfabgl_1_1ui_app.html">uiApp</a> *&#160;</td>
          <td class="paramname"><em>app</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets current UI app. </p>
<p>To use this generateVirtualKeys must be true in <a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93" title="Initializes KeyboardClass specifying CLOCK and DATA GPIOs. ">begin()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">app</td><td>The UI app where to send keyboard events </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7d79d73d9a71bbe889a89cb6358d64db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d79d73d9a71bbe889a89cb6358d64db">&#9670;&nbsp;</a></span>suspendVirtualKeyGeneration()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::KeyboardClass::suspendVirtualKeyGeneration </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Suspends or resume the virtual key generation task. </p>
<p>Use this method to temporarily suspend the scancode to virtual key conversion task. This is useful when scancode are necessary for a limited time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>If true conversion task is suspended. If false conversion task is resumed. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a13">KeyboardStudio/KeyboardStudio.ino</a>.</dd>
</dl>
</div>
</div>
<a id="aed4e98813779c2d51bd304aef5aed7e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aed4e98813779c2d51bd304aef5aed7e9">&#9670;&nbsp;</a></span>unlock()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void fabgl::PS2DeviceClass::unlock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Releases device from exclusive access. </p>

</div>
</div>
<a id="aa93820f1c8f447a37c01376a8d6dbba0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa93820f1c8f447a37c01376a8d6dbba0">&#9670;&nbsp;</a></span>virtualKeyAvailable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fabgl::KeyboardClass::virtualKeyAvailable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the number of virtual keys available in the queue. </p>
<p>Virtual keys are generated from scancodes only if generateVirtualKeys parameter is true (default) and createVKQueue parameter is true (default) of <a class="el" href="classfabgl_1_1_keyboard_class.html#ae9d8a142c516c27a1760944b07a87f93" title="Initializes KeyboardClass specifying CLOCK and DATA GPIOs. ">KeyboardClass.begin()</a> method.</p>
<dl class="section return"><dt>Returns</dt><dd>The number of virtual keys available to read. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a17">KeyboardStudio/KeyboardStudio.ino</a>, and <a class="el" href="_v_i_c20_2_v_i_c20_8ino-example.html#a11">VIC20/VIC20.ino</a>.</dd>
</dl>
</div>
</div>
<a id="a7fba5778b3518e9aa2d397e0da71520e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fba5778b3518e9aa2d397e0da71520e">&#9670;&nbsp;</a></span>virtualKeyToASCII()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fabgl::KeyboardClass::virtualKeyToASCII </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___enumerations.html#gae12c31a33f64281cba424d993a8a4381">VirtualKey</a>&#160;</td>
          <td class="paramname"><em>virtualKey</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts virtual key to ASCII. </p>
<p>This method converts the specified virtual key to ASCII, if possible.<br />
 For example VK_A is converted to 'A' (ASCII 0x41), CTRL + VK_SPACE produces ASCII NUL (0x00), CTRL + letter produces ASCII control codes from SOH (0x01) to SUB (0x1A), CTRL + VK_BACKSLASH produces ASCII FS (0x1C), CTRL + VK_QUESTION produces ASCII US (0x1F), CTRL + VK_LEFTBRACKET produces ASCII ESC (0x1B), CTRL + VK_RIGHTBRACKET produces ASCII GS (0x1D), CTRL + VK_TILDE produces ASCII RS (0x1E) and VK_SCROLLLOCK produces XON or XOFF.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">virtualKey</td><td>The virtual key to convert.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The ASCII code of virtual key or -1 if virtual key cannot be translated to ASCII. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_keyboard_studio_2_keyboard_studio_8ino-example.html#a20">KeyboardStudio/KeyboardStudio.ino</a>.</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="keyboard_8h_source.html">keyboard.h</a></li>
<li>keyboard.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>fabgl</b></li><li class="navelem"><a class="el" href="classfabgl_1_1_keyboard_class.html">KeyboardClass</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
